package com.bodu.system.mapper;

import com.bodu.core.common.CommonMapper;
import com.bodu.system.entity.request.CodeGenRequest;
import com.bodu.system.entity.vo.CodeGenVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author Administrator
 */
@Mapper
public interface CodeGenMapper extends CommonMapper<CodeGenRequest, CodeGenVo> {

    /**
     * 根据数据源名称和表名称得到Columns的集合
     *
     * @param datasourceName
     * @param tableName
     * @return
     */
    List<Map<String, Object>> listColumnsByDatabaseAndTable(@Param("datasourceName") String datasourceName, @Param("tableName") String tableName);

    /**
     * 根据数据源和表名称删除生成的代码
     *
     * @param datasourceName
     * @param tableName
     * @return
     */
    Integer deleteByDatasourceNameAndTableName(@Param("datasourceName") String datasourceName, @Param("tableName") String tableName);
}
